const app = getApp();
Component({
  data: {
    selected: 0,
    color: "#7a7e83",
    selectedColor: "#2c2c2c",
    waitTabCount: 0,
    dynamicCount: 0,
    list: [],
    usingComponents: {}
  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset;
      const url = data.url;
      wx.switchTab({ url });
    },
    setList(list = []) {
      this.setData({ list });
      this.data.list = list;
    }
  },
  ready() {
    // // 先设置回调
    app.setTabBarList = (list) => {
      this.setList(list);
    };
    let list = wx.getStorageSync("tabbarPages");
  
    console.log(list);
    if (!list) return;
    list = JSON.parse(list);
    if (list.length > 0) {
      this.setList(list);
    }
  }
});
